import { NgModule } from '@angular/core';
import { RouterModule, Routes } from '@angular/router';
import { processComponent } from './process.component';
import { ProcessItemComponent } from './process-item/process-item.component';
import { AddProcessComponent } from './process-item/add-process/add-process.component';
import { EditProcessComponent } from './process-item/edit-process/edit-process.component';
import { TechnologyRouteComponent } from './technology-route/technology-route.component';
import { AddTechnologyRouteComponent } from './technology-route/add-technology-route/add-technology-route.component';
import { EditTechnologyRouteComponent } from './technology-route/edit-technology-route/edit-technology-route.component';
import { MOMComponent } from './mom/mom.component';
import { AddMOMComponent } from './mom/add-mom/add-mom.component';
import { EditMomComponent } from './mom/edit-mom/edit-mom.component';
import { CanActivateGuard } from 'src/app/@core/services/can-load-service.guard';

const routes: Routes = [
  {
    path:'',
    component:processComponent,
    children:[
      {
        path: 'process-item',
        component: ProcessItemComponent,
        canActivate: [CanActivateGuard]
      },
      {
        path: 'process-item/add-process',
        component: AddProcessComponent,
        canActivate: [CanActivateGuard]
      },{
        path: 'process-item/edit-process/:processId',
        component: EditProcessComponent,
        canActivate: [CanActivateGuard]
      },{
        path:"technology-route",
        component:TechnologyRouteComponent,
        canActivate: [CanActivateGuard]
      },{
        path:"technology-route/add-technology-route",
        component:AddTechnologyRouteComponent,
        canActivate: [CanActivateGuard]
      },{
        path:'technology-route/edit-technology-route/:technologyRouteId',
        component:EditTechnologyRouteComponent,
        canActivate: [CanActivateGuard]
      },{
        path:'mom',
        component:MOMComponent,
        canActivate: [CanActivateGuard]
      },{
        path:'mom/add-mom',
        component:AddMOMComponent,
        canActivate: [CanActivateGuard]
      },{
        path:'mom/edit-mom/:momId',
        component:EditMomComponent,
        canActivate: [CanActivateGuard]
      },{
        path: '',
        redirectTo: 'process-item',
        pathMatch: 'full',
      }
    ]
  },
];

@NgModule({
  imports: [RouterModule.forChild(routes)],
  exports: [RouterModule]
})
export class ProcessRoutingModule { }
